/****************************************************
          File Name:6-5.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Fri 19 Dec 2014 02:41:21 PM CST
*****************************************************/

#include<iostream>
using namespace std;

int main()
{
    int income = 0;
    float tax;

    while(cin >> income)
    {
        if(income < 0)
            break;
        if(income <= 5000)
            cout << "Tax is: 0.0 \n";
        else if(5000 < income && income <= 15000)
        {
            tax = (income - 5000) * 0.1; 
            cout << "Tax is: " << tax << endl;
        }
        else if(15000 < income && income <= 35000)
        {
            tax = (income - 15000) * 0.15 + 10000 * 0.10 + 5000 * 0.0;
            cout << "Tax is: " << tax << endl;
        }
        else if(35000 < income)
        {
            tax = 5000 * 0.0 + 10000 * 0.1 + 20000 * 0.15 + (income - 35000) * 0.2;
            cout << "Tax is: " << tax << endl;
        }
    }

    cout << "Bye\n" ;

    return 0;
}
